
<div>
    @* or use template *@
    @*
        <SwitcherIconTemplate Context="node">
            <Icon Type="down" Class="{PREFIX_CLS}-switcher-icon" />
        </SwitcherIconTemplate>
    *@
    <Tree Nodes="TreeNodes" SwitcherIcon="down"></Tree>
</div>


@code{


    List<TreeNode> _treeNodes;

    public List<TreeNode> TreeNodes
    {
        get
        {
            if (_treeNodes != null)
                return _treeNodes;

            _treeNodes = new List<TreeNode>()
{
                new TreeNode
                {
                    Text="parent 1",IsExpanded=true,
                    IconTemplate=(node)=>@<Icon Type="smile" />,
                    Nodes =
                    {
                        new TreeNode
                        {
                            Text="leaf"
                            ,
                            IconTemplate=(node)=>@<Icon Type="smile" />
                        }
                        ,
                        new TreeNode
                        {
                            Text="leaf"
                            ,
                            IconTemplate=(node)=> node.IsSelected?(RenderFragment)(@<Icon Type="frown" Theme="fill" />):(@<Icon Type="frown" Theme="outline" />)
                        }
                    }
                }
            };

                return _treeNodes;
            }
        }


}


